package android.content;

import android.accounts.Account;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;

public interface ISyncAdapter extends IInterface {

    public static class Default implements ISyncAdapter {
        @Override  // android.os.IInterface
        public IBinder asBinder() {
            return null;
        }

        @Override  // android.content.ISyncAdapter
        public void cancelSync(ISyncContext arg1) throws RemoteException {
        }

        @Override  // android.content.ISyncAdapter
        public void onUnsyncableAccount(ISyncAdapterUnsyncableAccountCallback arg1) throws RemoteException {
        }

        @Override  // android.content.ISyncAdapter
        public void startSync(ISyncContext arg1, String arg2, Account arg3, Bundle arg4) throws RemoteException {
        }
    }


    abstract class Stub extends Binder implements ISyncAdapter {
        static class Proxy implements ISyncAdapter {
            private IBinder mRemote;
            public static ISyncAdapter sDefaultImpl;

            Proxy(IBinder arg1) {
                this.mRemote = arg1;
            }

            @Override  // android.os.IInterface
            public IBinder asBinder() {
                return this.mRemote;
            }

            @Override  // android.content.ISyncAdapter
            public void cancelSync(ISyncContext arg6) throws RemoteException {
                Parcel v0 = Parcel.obtain();
                Parcel v1 = Parcel.obtain();
                try {
                    v0.writeInterfaceToken("android.content.ISyncAdapter");
                    IBinder v2 = arg6 == null ? null : arg6.asBinder();
                    v0.writeStrongBinder(v2);
                    if (!this.mRemote.transact(1, v0, v1, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().cancelSync(arg6);
                        v1.recycle();
                        v0.recycle();
                        return;
                    }

                    try {
                        v1.readException();
                    } catch (Throwable v6) {
                        v1.recycle();
                        v0.recycle();
                        throw v6;
                    }

                } catch (Throwable v6) {
                    v1.recycle();
                    v0.recycle();
                    throw v6;
                }


                v1.recycle();
                v0.recycle();
            }

            public String getInterfaceDescriptor() {
                return "android.content.ISyncAdapter";
            }

            @Override  // android.content.ISyncAdapter
            public void onUnsyncableAccount(ISyncAdapterUnsyncableAccountCallback arg6) throws RemoteException {
                Parcel v0 = Parcel.obtain();
                Parcel v1 = Parcel.obtain();
                try {
                    v0.writeInterfaceToken("android.content.ISyncAdapter");
                    IBinder v2 = arg6 == null ? null : arg6.asBinder();
                    v0.writeStrongBinder(v2);
                    if (!this.mRemote.transact(2, v0, v1, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().onUnsyncableAccount(arg6);
                        v1.recycle();
                        v0.recycle();
                        return;
                    }

                    try {
                        v1.readException();
                    } catch (Throwable v6) {
                        v1.recycle();
                        v0.recycle();
                        throw v6;
                    }
                } catch (Throwable v6) {
                    v1.recycle();
                    v0.recycle();
                    throw v6;
                }


                v1.recycle();
                v0.recycle();
            }
            @Override  // android.content.ISyncAdapter
            public void startSync(ISyncContext arg6, String arg7, Account arg8, Bundle arg9) throws RemoteException {
                Parcel v0 = Parcel.obtain();
                Parcel v1 = Parcel.obtain();
                try {
                    v0.writeInterfaceToken("android.content.ISyncAdapter");
                    IBinder v2 = arg6 == null ? null : arg6.asBinder();
                    v0.writeStrongBinder(v2);
                    v0.writeString(arg7);
                    if (arg8 == null) {
                        v0.writeInt(0);
                    } else {
                        v0.writeInt(1);
                        arg8.writeToParcel(v0, 0);
                    }

                    if (arg9 == null) {
                        v0.writeInt(0);
                    } else {
                        v0.writeInt(1);
                        arg9.writeToParcel(v0, 0);
                    }

                    if (!this.mRemote.transact(3, v0, v1, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().startSync(arg6, arg7, arg8, arg9);
                        v1.recycle();
                        v0.recycle();
                        return;
                    }

                    try {
                        v1.readException();
                        if (v1.readInt() != 0) {
                            arg9.readFromParcel(v1);
                        }
                    } catch (Throwable v6) {
                        v1.recycle();
                        v0.recycle();
                        throw v6;
                    }
                } catch (Throwable v6) {
                    v1.recycle();
                    v0.recycle();
                    throw v6;
                }

                v1.recycle();
                v0.recycle();
            }
        }

        private static final String DESCRIPTOR = "android.content.ISyncAdapter";
        static final int TRANSACTION_cancelSync = 1;
        static final int TRANSACTION_onUnsyncableAccount = 2;
        static final int TRANSACTION_startSync = 3;

        public Stub() {
            this.attachInterface(this, "android.content.ISyncAdapter");
        }

        @Override  // android.os.IInterface
        public IBinder asBinder() {
            return this;
        }

        public static ISyncAdapter asInterface(IBinder arg2) {
            if (arg2 == null) {
                return null;
            }

            IInterface v0 = arg2.queryLocalInterface("android.content.ISyncAdapter");
            return v0 == null || !(v0 instanceof ISyncAdapter) ? new Proxy(arg2) : ((ISyncAdapter) v0);
        }

        public static ISyncAdapter getDefaultImpl() {
            return Proxy.sDefaultImpl;
        }

        @Override  // android.os.Binder
        public boolean onTransact(int arg5, Parcel arg6, Parcel arg7, int arg8) throws RemoteException {
            if (arg5 != 1) {
                if (arg5 != 2) {
                    if (arg5 != 3) {
                        if (arg5 != 0x5F4E5446) {
                            return super.onTransact(arg5, arg6, arg7, arg8);
                        }

                        arg7.writeString("android.content.ISyncAdapter");
                        return true;
                    }

                    arg6.enforceInterface("android.content.ISyncAdapter");
                    ISyncContext v5 = android.content.ISyncContext.Stub.asInterface(arg6.readStrongBinder());
                    String v8 = arg6.readString();
                    Bundle v2 = null;
                    Account v1 = arg6.readInt() == 0 ? null : ((Account) Account.CREATOR.createFromParcel(arg6));
                    if (arg6.readInt() != 0) {
                        v2 = (Bundle) Bundle.CREATOR.createFromParcel(arg6);
                    }

                    this.startSync(v5, v8, v1, v2);
                    arg7.writeNoException();
                    if (v2 != null) {
                        arg7.writeInt(1);
                        v2.writeToParcel(arg7, 1);
                        return true;
                    }

                    arg7.writeInt(0);
                    return true;
                }

                arg6.enforceInterface("android.content.ISyncAdapter");
                this.onUnsyncableAccount(android.content.ISyncAdapterUnsyncableAccountCallback.Stub.asInterface(arg6.readStrongBinder()));
                arg7.writeNoException();
                return true;
            }

            arg6.enforceInterface("android.content.ISyncAdapter");
            this.cancelSync(android.content.ISyncContext.Stub.asInterface(arg6.readStrongBinder()));
            arg7.writeNoException();
            return true;
        }

        public static boolean setDefaultImpl(ISyncAdapter arg1) {
            if (Proxy.sDefaultImpl == null && arg1 != null) {
                Proxy.sDefaultImpl = arg1;
                return true;
            }

            return false;
        }
    }


    void cancelSync(ISyncContext arg1) throws RemoteException;

    void onUnsyncableAccount(ISyncAdapterUnsyncableAccountCallback arg1) throws RemoteException;

    void startSync(ISyncContext arg1, String arg2, Account arg3, Bundle arg4) throws RemoteException;

}
